package view;

import model.User;

public class ViewManager {
	
	User user = null;
	View view;
	
	public ViewManager(User user){
		
		this.user = user;
		
	}
	
	public void displayView(){
		if(user.getRole().trim().equalsIgnoreCase("manager")){
			view = new ManagerView(user);
			view.processView();
		}else if (user.getRole().trim().equalsIgnoreCase("SalesRep")){
			view = new RepView(user);
			view.processView();
		}else if (user.getRole().trim().equalsIgnoreCase("Administrator")){
			view = new AdminView(user);
			view.processView();
		}else{
			view = new DefaultView(user);
			view.processView();
		}
	}
	
	public Object retrieveObject(long id){
		return view.retrieveObject(id);
	}

}
